@@ -12,7 +12,7 @@ using namespace std;
12
12
void netlink_parse_rtattr (struct rtattr **tb, int max, struct rtattr *rta,
13
13
int len)
14
14
{
15
- while (RTA_OK (rta, len))
15
+ while (RTA_OK (rta, len))
16
16
{
17
17
if (rta->rta_type <= max)
18
18
{
@@ -33,6 +33,11 @@ void netlink_parse_rtattr(struct rtattr **tb, int max, struct rtattr *rta,
33
33
rta = RTA_NEXT (rta, len);
34
34
}
35
35
}
36
+ void netlink_parse_rtattr_nested (struct rtattr **tb, int max,
37
+ const struct rtattr *rta)
38
+ {
39
+ netlink_parse_rtattr (tb, max, (struct rtattr *)RTA_DATA (rta), (int )RTA_PAYLOAD (rta));
40
+ }
36
41
37
42
bool FpmLink::isRawProcessing (struct nlmsghdr *h)
38
43
{
@@ -54,7 +59,7 @@ bool FpmLink::isRawProcessing(struct nlmsghdr *h)
54
59
}
55
60
56
61
len = (int )(h->nlmsg_len - NLMSG_LENGTH (sizeof (struct rtmsg )));
57
- if (len < 0 )
62
+ if (len < 0 )
58
63
{
59
64
return false ;
60
65
}
@@ -71,19 +76,19 @@ bool FpmLink::isRawProcessing(struct nlmsghdr *h)
71
76
else
72
77
{
73
78
/* This is a multipath route */
74
- int len;
79
+ int len;
75
80
struct rtnexthop *rtnh = (struct rtnexthop *)RTA_DATA (tb[RTA_MULTIPATH]);
76
81
len = (int )RTA_PAYLOAD (tb[RTA_MULTIPATH]);
77
82
struct rtattr *subtb[RTA_MAX + 1 ];
78
-
79
- for (;;)
83
+
84
+ for (;;)
80
85
{
81
86
if (len < (int )sizeof (*rtnh) || rtnh->rtnh_len > len)
82
87
{
83
88
break ;
84
89
}
85
90
86
- if (rtnh->rtnh_len > sizeof (*rtnh))
91
+ if (rtnh->rtnh_len > sizeof (*rtnh))
87
92
{
88
93
memset (subtb, 0 , sizeof (subtb));
89
94
netlink_parse_rtattr (subtb, RTA_MAX, RTNH_DATA (rtnh),
@@ -101,7 +106,7 @@ bool FpmLink::isRawProcessing(struct nlmsghdr *h)
101
106
}
102
107
103
108
len -= NLMSG_ALIGN (rtnh->rtnh_len );
104
- rtnh = RTNH_NEXT (rtnh);
109
+ rtnh = RTNH_NEXT (rtnh);
105
110
}
106
111
}
107
112
@@ -281,7 +286,17 @@ void FpmLink::processFpmMessage(fpm_msg_hdr_t* hdr)
281
286
/* EVPN Type5 Add route processing */
282
287
processRawMsg (nl_hdr);
283
288
}
284
- else if (nl_hdr->nlmsg_type == RTM_NEWNEXTHOP || nl_hdr->nlmsg_type == RTM_DELNEXTHOP)
289
+ else if (nl_hdr->nlmsg_type == RTM_NEWSRV6VPNROUTE || nl_hdr->nlmsg_type == RTM_DELSRV6VPNROUTE)
290
+ {
291
+ /* rtnl api dont support RTM_NEWNEXTHOP/RTM_DELNEXTHOP yet. Processing as raw message*/
292
+ processRawMsg (nl_hdr);
293
+ }
294
+ else if (nl_hdr->nlmsg_type == RTM_NEWNEXTHOP || nl_hdr->nlmsg_type == RTM_DELNEXTHOP)
295
+ {
296
+ /* rtnl api dont support RTM_NEWNEXTHOP/RTM_DELNEXTHOP yet. Processing as raw message*/
297
+ processRawMsg (nl_hdr);
298
+ }
299
+ else if (nl_hdr->nlmsg_type == RTM_NEWPICCONTEXT || nl_hdr->nlmsg_type == RTM_DELPICCONTEXT)
285
300
{
286
301
/* rtnl api dont support RTM_NEWNEXTHOP/RTM_DELNEXTHOP yet. Processing as raw message*/
287
302
processRawMsg (nl_hdr);
0 commit comments