fib_rules.c (30596ec32e2cd141d73ee8701386887def9e98c0) | fib_rules.c (b16fb418b1bf2a9f14d5d2a4fe29bde1f5550b37) |
---|---|
1/* 2 * INET An implementation of the TCP/IP protocol suite for the LINUX 3 * operating system. INET is implemented using the BSD Socket 4 * interface as the means of communication with the user level. 5 * 6 * IPv4 Forwarding Information Base: policy rules. 7 * 8 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> --- 199 unchanged lines hidden (view full) --- 208 209static const struct nla_policy fib4_rule_policy[FRA_MAX+1] = { 210 FRA_GENERIC_POLICY, 211 [FRA_FLOW] = { .type = NLA_U32 }, 212}; 213 214static int fib4_rule_configure(struct fib_rule *rule, struct sk_buff *skb, 215 struct fib_rule_hdr *frh, | 1/* 2 * INET An implementation of the TCP/IP protocol suite for the LINUX 3 * operating system. INET is implemented using the BSD Socket 4 * interface as the means of communication with the user level. 5 * 6 * IPv4 Forwarding Information Base: policy rules. 7 * 8 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> --- 199 unchanged lines hidden (view full) --- 208 209static const struct nla_policy fib4_rule_policy[FRA_MAX+1] = { 210 FRA_GENERIC_POLICY, 211 [FRA_FLOW] = { .type = NLA_U32 }, 212}; 213 214static int fib4_rule_configure(struct fib_rule *rule, struct sk_buff *skb, 215 struct fib_rule_hdr *frh, |
216 struct nlattr **tb) | 216 struct nlattr **tb, 217 struct netlink_ext_ack *extack) |
217{ 218 struct net *net = sock_net(skb->sk); 219 int err = -EINVAL; 220 struct fib4_rule *rule4 = (struct fib4_rule *) rule; 221 | 218{ 219 struct net *net = sock_net(skb->sk); 220 int err = -EINVAL; 221 struct fib4_rule *rule4 = (struct fib4_rule *) rule; 222 |
222 if (frh->tos & ~IPTOS_TOS_MASK) | 223 if (frh->tos & ~IPTOS_TOS_MASK) { 224 NL_SET_ERR_MSG(extack, "Invalid tos"); |
223 goto errout; | 225 goto errout; |
226 } |
|
224 225 /* split local/main if they are not already split */ 226 err = fib_unmerge(net); 227 if (err) 228 goto errout; 229 230 if (rule->table == RT_TABLE_UNSPEC && !rule->l3mdev) { 231 if (rule->action == FR_ACT_TO_TBL) { --- 191 unchanged lines hidden --- | 227 228 /* split local/main if they are not already split */ 229 err = fib_unmerge(net); 230 if (err) 231 goto errout; 232 233 if (rule->table == RT_TABLE_UNSPEC && !rule->l3mdev) { 234 if (rule->action == FR_ACT_TO_TBL) { --- 191 unchanged lines hidden --- |