OpenWrt – Diff between revs 2 and 3
?pathlinks?
Rev 2 | Rev 3 | |||
---|---|---|---|---|
Line 290... | Line 290... | |||
290 | + } |
290 | + } |
|
291 | + |
291 | + |
|
292 | __skb_tunnel_rx(skb, tunnel->dev, tunnel->net); |
292 | __skb_tunnel_rx(skb, tunnel->dev, tunnel->net); |
|
Line 293... | Line 293... | |||
293 | |
293 | |
|
294 | err = dscp_ecn_decapsulate(tunnel, ipv6h, skb); |
294 | err = dscp_ecn_decapsulate(tunnel, ipv6h, skb); |
|
295 | @@ -962,6 +1101,7 @@ static void init_tel_txopt(struct ipv6_t |
295 | @@ -961,6 +1100,7 @@ static void init_tel_txopt(struct ipv6_t |
|
296 | opt->ops.opt_nflen = 8; |
296 | opt->ops.opt_nflen = 8; |
|
Line 297... | Line 297... | |||
297 | } |
297 | } |
|
298 | |
298 | |
|
299 | + |
299 | + |
|
300 | /** |
300 | /** |
|
301 | * ip6_tnl_addr_conflict - compare packet addresses to tunnel's own |
301 | * ip6_tnl_addr_conflict - compare packet addresses to tunnel's own |
|
302 | * @t: the outgoing tunnel device |
302 | * @t: the outgoing tunnel device |
|
303 | @@ -1300,6 +1440,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str |
303 | @@ -1298,6 +1438,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str |
|
304 | { |
304 | { |
|
305 | struct ip6_tnl *t = netdev_priv(dev); |
305 | struct ip6_tnl *t = netdev_priv(dev); |
|
306 | struct ipv6hdr *ipv6h; |
306 | struct ipv6hdr *ipv6h = ipv6_hdr(skb); |
|
307 | + struct __ip6_tnl_fmr *fmr; |
307 | + struct __ip6_tnl_fmr *fmr; |
|
308 | int encap_limit = -1; |
308 | int encap_limit = -1; |
|
309 | __u16 offset; |
309 | __u16 offset; |
|
310 | struct flowi6 fl6; |
310 | struct flowi6 fl6; |
|
311 | @@ -1362,6 +1503,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str |
311 | @@ -1356,6 +1497,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str |
|
Line 312... | Line 312... | |||
312 | fl6.flowi6_mark = skb->mark; |
312 | fl6.flowi6_mark = skb->mark; |
|
313 | } |
313 | } |
|
Line 325... | Line 325... | |||
325 | + ip4ip6_fmr_calc(&fl6.daddr, ip_hdr(skb), skb_tail_pointer(skb), fmr, true); |
325 | + ip4ip6_fmr_calc(&fl6.daddr, ip_hdr(skb), skb_tail_pointer(skb), fmr, true); |
|
326 | + |
326 | + |
|
327 | if (iptunnel_handle_offloads(skb, SKB_GSO_IPXIP6)) |
327 | if (iptunnel_handle_offloads(skb, SKB_GSO_IPXIP6)) |
|
328 | return -1; |
328 | return -1; |
|
Line 329... | Line 329... | |||
329 | |
329 | |
|
330 | @@ -1489,6 +1642,14 @@ ip6_tnl_change(struct ip6_tnl *t, const |
330 | @@ -1483,6 +1636,14 @@ ip6_tnl_change(struct ip6_tnl *t, const |
|
331 | t->parms.flowinfo = p->flowinfo; |
331 | t->parms.flowinfo = p->flowinfo; |
|
332 | t->parms.link = p->link; |
332 | t->parms.link = p->link; |
|
333 | t->parms.proto = p->proto; |
333 | t->parms.proto = p->proto; |
|
334 | + |
334 | + |
|
Line 340... | Line 340... | |||
340 | + t->parms.fmrs = p->fmrs; |
340 | + t->parms.fmrs = p->fmrs; |
|
341 | + |
341 | + |
|
342 | dst_cache_reset(&t->dst_cache); |
342 | dst_cache_reset(&t->dst_cache); |
|
343 | ip6_tnl_link_config(t); |
343 | ip6_tnl_link_config(t); |
|
344 | return 0; |
344 | return 0; |
|
345 | @@ -1527,6 +1688,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_ |
345 | @@ -1521,6 +1682,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_ |
|
346 | p->flowinfo = u->flowinfo; |
346 | p->flowinfo = u->flowinfo; |
|
347 | p->link = u->link; |
347 | p->link = u->link; |
|
348 | p->proto = u->proto; |
348 | p->proto = u->proto; |
|
349 | + p->fmrs = NULL; |
349 | + p->fmrs = NULL; |
|
350 | memcpy(p->name, u->name, sizeof(u->name)); |
350 | memcpy(p->name, u->name, sizeof(u->name)); |
|
351 | } |
351 | } |
|
Line 352... | Line 352... | |||
352 | |
352 | |
|
353 | @@ -1904,6 +2066,15 @@ static int ip6_tnl_validate(struct nlatt |
353 | @@ -1898,6 +2060,15 @@ static int ip6_tnl_validate(struct nlatt |
|
354 | return 0; |
354 | return 0; |
|
Line 355... | Line 355... | |||
355 | } |
355 | } |
|
356 | |
356 | |
|
Line 364... | Line 364... | |||
364 | +}; |
364 | +}; |
|
365 | + |
365 | + |
|
366 | static void ip6_tnl_netlink_parms(struct nlattr *data[], |
366 | static void ip6_tnl_netlink_parms(struct nlattr *data[], |
|
367 | struct __ip6_tnl_parm *parms) |
367 | struct __ip6_tnl_parm *parms) |
|
368 | { |
368 | { |
|
369 | @@ -1938,6 +2109,46 @@ static void ip6_tnl_netlink_parms(struct |
369 | @@ -1932,6 +2103,46 @@ static void ip6_tnl_netlink_parms(struct |
|
Line 370... | Line 370... | |||
370 | |
370 | |
|
371 | if (data[IFLA_IPTUN_COLLECT_METADATA]) |
371 | if (data[IFLA_IPTUN_COLLECT_METADATA]) |
|
372 | parms->collect_md = true; |
372 | parms->collect_md = true; |
|
373 | + |
373 | + |
|
Line 411... | Line 411... | |||
411 | + } |
411 | + } |
|
412 | + } |
412 | + } |
|
413 | } |
413 | } |
|
Line 414... | Line 414... | |||
414 | |
414 | |
|
415 | static bool ip6_tnl_netlink_encap_parms(struct nlattr *data[], |
415 | static bool ip6_tnl_netlink_encap_parms(struct nlattr *data[], |
|
Line 416... | Line 416... | |||
416 | @@ -2051,6 +2262,12 @@ static void ip6_tnl_dellink(struct net_d |
416 | @@ -2045,6 +2256,12 @@ static void ip6_tnl_dellink(struct net_d |
|
417 | |
417 | |
|
418 | static size_t ip6_tnl_get_size(const struct net_device *dev) |
418 | static size_t ip6_tnl_get_size(const struct net_device *dev) |
|
419 | { |
419 | { |
|
Line 424... | Line 424... | |||
424 | + ++fmrs; |
424 | + ++fmrs; |
|
425 | + |
425 | + |
|
426 | return |
426 | return |
|
427 | /* IFLA_IPTUN_LINK */ |
427 | /* IFLA_IPTUN_LINK */ |
|
428 | nla_total_size(4) + |
428 | nla_total_size(4) + |
|
429 | @@ -2078,6 +2295,24 @@ static size_t ip6_tnl_get_size(const str |
429 | @@ -2072,6 +2289,24 @@ static size_t ip6_tnl_get_size(const str |
|
430 | nla_total_size(2) + |
430 | nla_total_size(2) + |
|
431 | /* IFLA_IPTUN_COLLECT_METADATA */ |
431 | /* IFLA_IPTUN_COLLECT_METADATA */ |
|
432 | nla_total_size(0) + |
432 | nla_total_size(0) + |
|
433 | + /* IFLA_IPTUN_FMRS */ |
433 | + /* IFLA_IPTUN_FMRS */ |
|
434 | + nla_total_size(0) + |
434 | + nla_total_size(0) + |
|
Line 449... | Line 449... | |||
449 | + nla_total_size(1) |
449 | + nla_total_size(1) |
|
450 | + ) * fmrs + |
450 | + ) * fmrs + |
|
451 | 0; |
451 | 0; |
|
452 | } |
452 | } |
|
Line 453... | Line 453... | |||
453 | |
453 | |
|
454 | @@ -2085,6 +2320,9 @@ static int ip6_tnl_fill_info(struct sk_b |
454 | @@ -2079,6 +2314,9 @@ static int ip6_tnl_fill_info(struct sk_b |
|
455 | { |
455 | { |
|
456 | struct ip6_tnl *tunnel = netdev_priv(dev); |
456 | struct ip6_tnl *tunnel = netdev_priv(dev); |
|
457 | struct __ip6_tnl_parm *parm = &tunnel->parms; |
457 | struct __ip6_tnl_parm *parm = &tunnel->parms; |
|
458 | + struct __ip6_tnl_fmr *c; |
458 | + struct __ip6_tnl_fmr *c; |
|
459 | + int fmrcnt = 0; |
459 | + int fmrcnt = 0; |
|
Line 460... | Line 460... | |||
460 | + struct nlattr *fmrs; |
460 | + struct nlattr *fmrs; |
|
461 | |
461 | |
|
462 | if (nla_put_u32(skb, IFLA_IPTUN_LINK, parm->link) || |
462 | if (nla_put_u32(skb, IFLA_IPTUN_LINK, parm->link) || |
|
463 | nla_put_in6_addr(skb, IFLA_IPTUN_LOCAL, &parm->laddr) || |
463 | nla_put_in6_addr(skb, IFLA_IPTUN_LOCAL, &parm->laddr) || |
|
464 | @@ -2093,9 +2331,27 @@ static int ip6_tnl_fill_info(struct sk_b |
464 | @@ -2087,9 +2325,27 @@ static int ip6_tnl_fill_info(struct sk_b |
|
465 | nla_put_u8(skb, IFLA_IPTUN_ENCAP_LIMIT, parm->encap_limit) || |
465 | nla_put_u8(skb, IFLA_IPTUN_ENCAP_LIMIT, parm->encap_limit) || |
|
466 | nla_put_be32(skb, IFLA_IPTUN_FLOWINFO, parm->flowinfo) || |
466 | nla_put_be32(skb, IFLA_IPTUN_FLOWINFO, parm->flowinfo) || |
|
467 | nla_put_u32(skb, IFLA_IPTUN_FLAGS, parm->flags) || |
467 | nla_put_u32(skb, IFLA_IPTUN_FLAGS, parm->flags) || |
|
Line 488... | Line 488... | |||
488 | + nla_nest_end(skb, fmrs); |
488 | + nla_nest_end(skb, fmrs); |
|
489 | + |
489 | + |
|
490 | if (nla_put_u16(skb, IFLA_IPTUN_ENCAP_TYPE, tunnel->encap.type) || |
490 | if (nla_put_u16(skb, IFLA_IPTUN_ENCAP_TYPE, tunnel->encap.type) || |
|
491 | nla_put_be16(skb, IFLA_IPTUN_ENCAP_SPORT, tunnel->encap.sport) || |
491 | nla_put_be16(skb, IFLA_IPTUN_ENCAP_SPORT, tunnel->encap.sport) || |
|
492 | nla_put_be16(skb, IFLA_IPTUN_ENCAP_DPORT, tunnel->encap.dport) || |
492 | nla_put_be16(skb, IFLA_IPTUN_ENCAP_DPORT, tunnel->encap.dport) || |
|
493 | @@ -2133,6 +2389,7 @@ static const struct nla_policy ip6_tnl_p |
493 | @@ -2127,6 +2383,7 @@ static const struct nla_policy ip6_tnl_p |
|
494 | [IFLA_IPTUN_ENCAP_SPORT] = { .type = NLA_U16 }, |
494 | [IFLA_IPTUN_ENCAP_SPORT] = { .type = NLA_U16 }, |
|
495 | [IFLA_IPTUN_ENCAP_DPORT] = { .type = NLA_U16 }, |
495 | [IFLA_IPTUN_ENCAP_DPORT] = { .type = NLA_U16 }, |
|
496 | [IFLA_IPTUN_COLLECT_METADATA] = { .type = NLA_FLAG }, |
496 | [IFLA_IPTUN_COLLECT_METADATA] = { .type = NLA_FLAG }, |
|
497 | + [IFLA_IPTUN_FMRS] = { .type = NLA_NESTED }, |
497 | + [IFLA_IPTUN_FMRS] = { .type = NLA_NESTED }, |
|
498 | }; |
498 | }; |