net: mark net_proto_ops as const
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / net / ipv4 / af_inet.c
index 6c30a73f03f58e0c96f07e1292809b176c09f595..1deff48b122e2756f6e5fb1462a23eab72c69634 100644 (file)
@@ -244,7 +244,7 @@ EXPORT_SYMBOL(build_ehash_secret);
 static inline int inet_netns_ok(struct net *net, int protocol)
 {
        int hash;
-       struct net_protocol *ipprot;
+       const struct net_protocol *ipprot;
 
        if (net_eq(net, &init_net))
                return 1;
@@ -931,7 +931,7 @@ static const struct proto_ops inet_sockraw_ops = {
 #endif
 };
 
-static struct net_proto_family inet_family_ops = {
+static const struct net_proto_family inet_family_ops = {
        .family = PF_INET,
        .create = inet_create,
        .owner  = THIS_MODULE,
@@ -1119,6 +1119,7 @@ int inet_sk_rebuild_header(struct sock *sk)
 {
        struct flowi fl = {
                .oif = sk->sk_bound_dev_if,
+               .mark = sk->sk_mark,
                .nl_u = {
                        .ip4_u = {
                                .daddr  = daddr,
@@ -1162,7 +1163,7 @@ EXPORT_SYMBOL(inet_sk_rebuild_header);
 static int inet_gso_send_check(struct sk_buff *skb)
 {
        struct iphdr *iph;
-       struct net_protocol *ops;
+       const struct net_protocol *ops;
        int proto;
        int ihl;
        int err = -EINVAL;
@@ -1198,7 +1199,7 @@ static struct sk_buff *inet_gso_segment(struct sk_buff *skb, int features)
 {
        struct sk_buff *segs = ERR_PTR(-EINVAL);
        struct iphdr *iph;
-       struct net_protocol *ops;
+       const struct net_protocol *ops;
        int proto;
        int ihl;
        int id;
@@ -1265,7 +1266,7 @@ out:
 static struct sk_buff **inet_gro_receive(struct sk_buff **head,
                                         struct sk_buff *skb)
 {
-       struct net_protocol *ops;
+       const struct net_protocol *ops;
        struct sk_buff **pp = NULL;
        struct sk_buff *p;
        struct iphdr *iph;
@@ -1342,7 +1343,7 @@ out:
 
 static int inet_gro_complete(struct sk_buff *skb)
 {
-       struct net_protocol *ops;
+       const struct net_protocol *ops;
        struct iphdr *iph = ip_hdr(skb);
        int proto = iph->protocol & (MAX_INET_PROTOS - 1);
        int err = -ENOSYS;
@@ -1427,13 +1428,13 @@ void snmp_mib_free(void *ptr[2])
 EXPORT_SYMBOL_GPL(snmp_mib_free);
 
 #ifdef CONFIG_IP_MULTICAST
-static struct net_protocol igmp_protocol = {
+static const struct net_protocol igmp_protocol = {
        .handler =      igmp_rcv,
        .netns_ok =     1,
 };
 #endif
 
-static struct net_protocol tcp_protocol = {
+static const struct net_protocol tcp_protocol = {
        .handler =      tcp_v4_rcv,
        .err_handler =  tcp_v4_err,
        .gso_send_check = tcp_v4_gso_send_check,
@@ -1444,7 +1445,7 @@ static struct net_protocol tcp_protocol = {
        .netns_ok =     1,
 };
 
-static struct net_protocol udp_protocol = {
+static const struct net_protocol udp_protocol = {
        .handler =      udp_rcv,
        .err_handler =  udp_err,
        .gso_send_check = udp4_ufo_send_check,
@@ -1453,7 +1454,7 @@ static struct net_protocol udp_protocol = {
        .netns_ok =     1,
 };
 
-static struct net_protocol icmp_protocol = {
+static const struct net_protocol icmp_protocol = {
        .handler =      icmp_rcv,
        .no_policy =    1,
        .netns_ok =     1,