aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/ip_gre.c12
-rw-r--r--net/ipv4/ipip.c12
2 files changed, 12 insertions, 12 deletions
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 6e7727f27393..6207275fc749 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -659,12 +659,12 @@ static bool ipgre_netlink_encap_parms(struct nlattr *data[],
659 659
660 if (data[IFLA_GRE_ENCAP_SPORT]) { 660 if (data[IFLA_GRE_ENCAP_SPORT]) {
661 ret = true; 661 ret = true;
662 ipencap->sport = nla_get_u16(data[IFLA_GRE_ENCAP_SPORT]); 662 ipencap->sport = nla_get_be16(data[IFLA_GRE_ENCAP_SPORT]);
663 } 663 }
664 664
665 if (data[IFLA_GRE_ENCAP_DPORT]) { 665 if (data[IFLA_GRE_ENCAP_DPORT]) {
666 ret = true; 666 ret = true;
667 ipencap->dport = nla_get_u16(data[IFLA_GRE_ENCAP_DPORT]); 667 ipencap->dport = nla_get_be16(data[IFLA_GRE_ENCAP_DPORT]);
668 } 668 }
669 669
670 return ret; 670 return ret;
@@ -786,10 +786,10 @@ static int ipgre_fill_info(struct sk_buff *skb, const struct net_device *dev)
786 786
787 if (nla_put_u16(skb, IFLA_GRE_ENCAP_TYPE, 787 if (nla_put_u16(skb, IFLA_GRE_ENCAP_TYPE,
788 t->encap.type) || 788 t->encap.type) ||
789 nla_put_u16(skb, IFLA_GRE_ENCAP_SPORT, 789 nla_put_be16(skb, IFLA_GRE_ENCAP_SPORT,
790 t->encap.sport) || 790 t->encap.sport) ||
791 nla_put_u16(skb, IFLA_GRE_ENCAP_DPORT, 791 nla_put_be16(skb, IFLA_GRE_ENCAP_DPORT,
792 t->encap.dport) || 792 t->encap.dport) ||
793 nla_put_u16(skb, IFLA_GRE_ENCAP_FLAGS, 793 nla_put_u16(skb, IFLA_GRE_ENCAP_FLAGS,
794 t->encap.flags)) 794 t->encap.flags))
795 goto nla_put_failure; 795 goto nla_put_failure;
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index b58d6689874c..915d215a7d14 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -366,12 +366,12 @@ static bool ipip_netlink_encap_parms(struct nlattr *data[],
366 366
367 if (data[IFLA_IPTUN_ENCAP_SPORT]) { 367 if (data[IFLA_IPTUN_ENCAP_SPORT]) {
368 ret = true; 368 ret = true;
369 ipencap->sport = nla_get_u16(data[IFLA_IPTUN_ENCAP_SPORT]); 369 ipencap->sport = nla_get_be16(data[IFLA_IPTUN_ENCAP_SPORT]);
370 } 370 }
371 371
372 if (data[IFLA_IPTUN_ENCAP_DPORT]) { 372 if (data[IFLA_IPTUN_ENCAP_DPORT]) {
373 ret = true; 373 ret = true;
374 ipencap->dport = nla_get_u16(data[IFLA_IPTUN_ENCAP_DPORT]); 374 ipencap->dport = nla_get_be16(data[IFLA_IPTUN_ENCAP_DPORT]);
375 } 375 }
376 376
377 return ret; 377 return ret;
@@ -460,10 +460,10 @@ static int ipip_fill_info(struct sk_buff *skb, const struct net_device *dev)
460 460
461 if (nla_put_u16(skb, IFLA_IPTUN_ENCAP_TYPE, 461 if (nla_put_u16(skb, IFLA_IPTUN_ENCAP_TYPE,
462 tunnel->encap.type) || 462 tunnel->encap.type) ||
463 nla_put_u16(skb, IFLA_IPTUN_ENCAP_SPORT, 463 nla_put_be16(skb, IFLA_IPTUN_ENCAP_SPORT,
464 tunnel->encap.sport) || 464 tunnel->encap.sport) ||
465 nla_put_u16(skb, IFLA_IPTUN_ENCAP_DPORT, 465 nla_put_be16(skb, IFLA_IPTUN_ENCAP_DPORT,
466 tunnel->encap.dport) || 466 tunnel->encap.dport) ||
467 nla_put_u16(skb, IFLA_IPTUN_ENCAP_FLAGS, 467 nla_put_u16(skb, IFLA_IPTUN_ENCAP_FLAGS,
468 tunnel->encap.flags)) 468 tunnel->encap.flags))
469 goto nla_put_failure; 469 goto nla_put_failure;