Make snat_skb() skb argument const.
authorBen Pfaff <blp@nicira.com>
Tue, 11 Nov 2008 21:01:12 +0000 (13:01 -0800)
committerBen Pfaff <blp@nicira.com>
Thu, 13 Nov 2008 20:38:45 +0000 (12:38 -0800)
After all, it doesn't modify it.

datapath/nx_act_snat.c
datapath/nx_act_snat.h

index 819299e..5ff8fed 100644 (file)
@@ -346,12 +346,12 @@ snat_skb_finish(struct sk_buff *skb)
 /* Update the MAC->IP mappings for the private side of the SNAT'd
  * interface. */
 static void
-update_mapping(struct net_bridge_port *p, struct sk_buff *skb)
+update_mapping(struct net_bridge_port *p, const struct sk_buff *skb)
 {
        unsigned long flags;
        struct snat_conf *sc;
-       struct iphdr *iph = ip_hdr(skb);
-       struct ethhdr *eh = eth_hdr(skb);
+       const struct iphdr *iph = ip_hdr(skb);
+       const struct ethhdr *eh = eth_hdr(skb);
        struct snat_mapping *m;
 
        spin_lock_irqsave(&p->lock, flags);
@@ -387,7 +387,7 @@ done:
  * unmodified.  'skb' is not consumed, so caller will need to free it.
  */
 void 
-snat_skb(struct datapath *dp, struct sk_buff *skb, int out_port)
+snat_skb(struct datapath *dp, const struct sk_buff *skb, int out_port)
 {
        struct net_bridge_port *p = dp->ports[out_port];
        struct sk_buff *nskb;
index 76797d4..7d5f37d 100644 (file)
@@ -30,7 +30,7 @@ struct snat_conf {
 
 void snat_local_in(struct sk_buff *skb);
 int snat_pre_route(struct sk_buff *skb);
-void snat_skb(struct datapath *dp, struct sk_buff *skb, int out_port);
+void snat_skb(struct datapath *dp, const struct sk_buff *skb, int out_port);
 void snat_maint(struct net_bridge_port *p);
 int snat_mod_config(struct datapath *, const struct nx_act_config *);
 int snat_free_conf(struct net_bridge_port *p);