aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_gre.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/ip_gre.c')
-rw-r--r--net/ipv4/ip_gre.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index ffa9f1c9dcbb..f151900efaf9 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -684,7 +684,7 @@ static int ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
684 goto tx_error; 684 goto tx_error;
685 } 685 }
686 686
687 if (dev->hard_header) { 687 if (dev->header_ops) {
688 gre_hlen = 0; 688 gre_hlen = 0;
689 tiph = (struct iphdr*)skb->data; 689 tiph = (struct iphdr*)skb->data;
690 } else { 690 } else {
@@ -1063,8 +1063,9 @@ static int ipgre_tunnel_change_mtu(struct net_device *dev, int new_mtu)
1063 1063
1064 */ 1064 */
1065 1065
1066static int ipgre_header(struct sk_buff *skb, struct net_device *dev, unsigned short type, 1066static int ipgre_header(struct sk_buff *skb, struct net_device *dev,
1067 void *daddr, void *saddr, unsigned len) 1067 unsigned short type,
1068 const void *daddr, const void *saddr, unsigned len)
1068{ 1069{
1069 struct ip_tunnel *t = netdev_priv(dev); 1070 struct ip_tunnel *t = netdev_priv(dev);
1070 struct iphdr *iph = (struct iphdr *)skb_push(skb, t->hlen); 1071 struct iphdr *iph = (struct iphdr *)skb_push(skb, t->hlen);
@@ -1091,6 +1092,10 @@ static int ipgre_header(struct sk_buff *skb, struct net_device *dev, unsigned sh
1091 return -t->hlen; 1092 return -t->hlen;
1092} 1093}
1093 1094
1095static const struct header_ops ipgre_header_ops = {
1096 .create = ipgre_header,
1097};
1098
1094static int ipgre_open(struct net_device *dev) 1099static int ipgre_open(struct net_device *dev)
1095{ 1100{
1096 struct ip_tunnel *t = netdev_priv(dev); 1101 struct ip_tunnel *t = netdev_priv(dev);
@@ -1187,7 +1192,7 @@ static int ipgre_tunnel_init(struct net_device *dev)
1187 if (!iph->saddr) 1192 if (!iph->saddr)
1188 return -EINVAL; 1193 return -EINVAL;
1189 dev->flags = IFF_BROADCAST; 1194 dev->flags = IFF_BROADCAST;
1190 dev->hard_header = ipgre_header; 1195 dev->header_ops = &ipgre_header_ops;
1191 dev->open = ipgre_open; 1196 dev->open = ipgre_open;
1192 dev->stop = ipgre_close; 1197 dev->stop = ipgre_close;
1193 } 1198 }