ip6_gre.c (bba73071b6f71be0a101658d7c13866e30b264a6) ip6_gre.c (b75cc8f90f07342467b3bd51dbc0054f185032c9)
1/*
2 * GRE over IPv6 protocol decoder.
3 *
4 * Authors: Dmitry Kozlov (xeb@mail.ru)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version

--- 1039 unchanged lines hidden (view full) ---

1048 t_hlen = t->hlen + sizeof(struct ipv6hdr);
1049
1050 if (p->flags & IP6_TNL_F_CAP_XMIT) {
1051 int strict = (ipv6_addr_type(&p->raddr) &
1052 (IPV6_ADDR_MULTICAST|IPV6_ADDR_LINKLOCAL));
1053
1054 struct rt6_info *rt = rt6_lookup(t->net,
1055 &p->raddr, &p->laddr,
1/*
2 * GRE over IPv6 protocol decoder.
3 *
4 * Authors: Dmitry Kozlov (xeb@mail.ru)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version

--- 1039 unchanged lines hidden (view full) ---

1048 t_hlen = t->hlen + sizeof(struct ipv6hdr);
1049
1050 if (p->flags & IP6_TNL_F_CAP_XMIT) {
1051 int strict = (ipv6_addr_type(&p->raddr) &
1052 (IPV6_ADDR_MULTICAST|IPV6_ADDR_LINKLOCAL));
1053
1054 struct rt6_info *rt = rt6_lookup(t->net,
1055 &p->raddr, &p->laddr,
1056 p->link, strict);
1056 p->link, NULL, strict);
1057
1058 if (!rt)
1059 return;
1060
1061 if (rt->dst.dev) {
1062 dev->hard_header_len = rt->dst.dev->hard_header_len +
1063 t_hlen;
1064

--- 447 unchanged lines hidden (view full) ---

1512 rtnl_unlock();
1513}
1514
1515static struct pernet_operations ip6gre_net_ops = {
1516 .init = ip6gre_init_net,
1517 .exit_batch = ip6gre_exit_batch_net,
1518 .id = &ip6gre_net_id,
1519 .size = sizeof(struct ip6gre_net),
1057
1058 if (!rt)
1059 return;
1060
1061 if (rt->dst.dev) {
1062 dev->hard_header_len = rt->dst.dev->hard_header_len +
1063 t_hlen;
1064

--- 447 unchanged lines hidden (view full) ---

1512 rtnl_unlock();
1513}
1514
1515static struct pernet_operations ip6gre_net_ops = {
1516 .init = ip6gre_init_net,
1517 .exit_batch = ip6gre_exit_batch_net,
1518 .id = &ip6gre_net_id,
1519 .size = sizeof(struct ip6gre_net),
1520 .async = true,
1520};
1521
1522static int ip6gre_tunnel_validate(struct nlattr *tb[], struct nlattr *data[],
1523 struct netlink_ext_ack *extack)
1524{
1525 __be16 flags;
1526
1527 if (!data)

--- 251 unchanged lines hidden (view full) ---

1779 dev->priv_destructor = ip6gre_dev_free;
1780
1781 dev->features |= NETIF_F_NETNS_LOCAL;
1782 dev->priv_flags &= ~IFF_TX_SKB_SHARING;
1783 dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
1784 netif_keep_dst(dev);
1785}
1786
1521};
1522
1523static int ip6gre_tunnel_validate(struct nlattr *tb[], struct nlattr *data[],
1524 struct netlink_ext_ack *extack)
1525{
1526 __be16 flags;
1527
1528 if (!data)

--- 251 unchanged lines hidden (view full) ---

1780 dev->priv_destructor = ip6gre_dev_free;
1781
1782 dev->features |= NETIF_F_NETNS_LOCAL;
1783 dev->priv_flags &= ~IFF_TX_SKB_SHARING;
1784 dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
1785 netif_keep_dst(dev);
1786}
1787
1788bool is_ip6gretap_dev(const struct net_device *dev)
1789{
1790 return dev->netdev_ops == &ip6gre_tap_netdev_ops;
1791}
1792EXPORT_SYMBOL_GPL(is_ip6gretap_dev);
1793
1787static bool ip6gre_netlink_encap_parms(struct nlattr *data[],
1788 struct ip_tunnel_encap *ipencap)
1789{
1790 bool ret = false;
1791
1792 memset(ipencap, 0, sizeof(*ipencap));
1793
1794 if (!data)

--- 365 unchanged lines hidden ---
1794static bool ip6gre_netlink_encap_parms(struct nlattr *data[],
1795 struct ip_tunnel_encap *ipencap)
1796{
1797 bool ret = false;
1798
1799 memset(ipencap, 0, sizeof(*ipencap));
1800
1801 if (!data)

--- 365 unchanged lines hidden ---