Thread (2 messages) flat view 2 messages, 2 authors, 2021-09-23

Re: [PATCH net] net: ipv4: Fix rtnexthop len when RTA_FLOW is present

From: David Ahern <hidden>
Date: 2021-09-23 04:13:41

On 9/22/21 4:16 AM, Xiao Liang wrote:
quoted hunk ↗ jump to hunk
@@ -1682,10 +1683,17 @@ int fib_add_nexthop(struct sk_buff *skb, const struct fib_nh_common *nhc,
 	/* length of rtnetlink header + attributes */
 	rtnh->rtnh_len = nlmsg_get_pos(skb) - (void *)rtnh;
 
-	return 0;
+	return rtnh;
 
 nla_put_failure:
-	return -EMSGSIZE;
+	return ERR_PTR(-EMSGSIZE);
+}
+
+int fib_add_nexthop(struct sk_buff *skb, const struct fib_nh_common *nhc,
+		    int nh_weight, u8 rt_family)
Adding classid as an input to fib_add_nexthop and checking it for non-0
before adding to the message is a better way to resolve this.

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help