diff options
author | Susant Sahani <susant@redhat.com> | 2014-12-20 13:35:06 +0530 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2015-01-22 21:29:41 +0100 |
commit | 1af2536acf8aecc3eb940d04268a419c956ee10a (patch) | |
tree | 41494d788c0bf6dca9bacabe5ae9a0d786bddc10 /src/network/networkd-netdev-tunnel.c | |
parent | 34109a531fb3b26fa00f0261987c7cca710e42aa (diff) |
networkd: introduce gretap
This patch introdeces gretap to networkd
Diffstat (limited to 'src/network/networkd-netdev-tunnel.c')
-rw-r--r-- | src/network/networkd-netdev-tunnel.c | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/src/network/networkd-netdev-tunnel.c b/src/network/networkd-netdev-tunnel.c index 31d34644ed..fde08fb1e6 100644 --- a/src/network/networkd-netdev-tunnel.c +++ b/src/network/networkd-netdev-tunnel.c @@ -140,14 +140,20 @@ static int netdev_sit_fill_message_create(NetDev *netdev, Link *link, sd_rtnl_me } static int netdev_gre_fill_message_create(NetDev *netdev, Link *link, sd_rtnl_message *m) { - Tunnel *t = GRE(netdev); + Tunnel *t; int r; assert(netdev); - assert(link); - assert(m); + + if (netdev->kind == NETDEV_KIND_GRE) + t = GRE(netdev); + else + t = GRETAP(netdev); + assert(t); assert(t->family == AF_INET); + assert(link); + assert(m); r = sd_rtnl_message_append_u32(m, IFLA_GRE_LINK, link->ifindex); if (r < 0) { @@ -253,6 +259,9 @@ static int netdev_tunnel_verify(NetDev *netdev, const char *filename) { case NETDEV_KIND_GRE: t = GRE(netdev); break; + case NETDEV_KIND_GRETAP: + t = GRETAP(netdev); + break; case NETDEV_KIND_VTI: t = VTI(netdev); break; @@ -339,9 +348,15 @@ static void vti_init(NetDev *n) { } static void gre_init(NetDev *n) { - Tunnel *t = GRE(n); + Tunnel *t; assert(n); + + if (n->kind == NETDEV_KIND_GRE) + t = GRE(n); + else + t = GRETAP(n); + assert(t); t->pmtudisc = true; @@ -382,3 +397,12 @@ const NetDevVTable gre_vtable = { .create_type = NETDEV_CREATE_STACKED, .config_verify = netdev_tunnel_verify, }; + +const NetDevVTable gretap_vtable = { + .object_size = sizeof(Tunnel), + .init = gre_init, + .sections = "Match\0NetDev\0Tunnel\0", + .fill_message_create = netdev_gre_fill_message_create, + .create_type = NETDEV_CREATE_STACKED, + .config_verify = netdev_tunnel_verify, +}; |