corrector
samedi 25 février 2012 à 08:17
Dans
linux-2.6.31.7-fbx.patch :
Code
diff -ruw linux-2.6.31.7/net/core/dev.c linux-2.6.31.7-fbx/net/core/dev.c
--- linux-2.6.31.7/net/core/dev.c 2009-12-08 20:13:50.000000000 +0100
+++ linux-2.6.31.7-fbx/net/core/dev.c 2010-10-25 13:43:58.361437288 +0200
Code
+#if defined(CONFIG_FREEBOX_BRIDGE) || defined(CONFIG_FREEBOX_BRIDGE_MODULE)
+struct sk_buff *(*fbxbridge_handle_frame_hook)(struct fbxbridge *p, struct sk_buff *skb);
+
+struct fbxbridge;
+
+static inline struct sk_buff *handle_fbxbridge(struct sk_buff *skb,
+ struct packet_type **pt_prev, int *ret,
+ struct net_device *orig_dev)
+{
+ struct fbxbridge *fbxbr;
+
+ if (skb->pkt_type == PACKET_LOOPBACK ||
+ (fbxbr = skb->dev->fbx_bridge_port) == NULL)
+ return skb;
+
+ if (skb->protocol != __constant_htons(ETH_P_IP) &&
+ skb->protocol != __constant_htons(ETH_P_ARP))
+ return skb;
+
+ if (*pt_prev) {
+ *ret = deliver_skb(skb, *pt_prev, orig_dev);
+ *pt_prev = NULL;
+ }
+
+ return fbxbridge_handle_frame_hook(fbxbr, skb);
+}
+#else
+#define handle_fbxbridge(skb, pt_prev, ret, orig_dev) (skb)
+#endif
Puisque jamais
fbxbridge_handle_frame_hook ne reçoit une valeur (autre que l'initialisation implicite à null des objets globaux), il est évident que ce code ne peut pas marcher en l'état! Il n'y a même pas de test à null avant d'invoquer
fbxbridge_handle_frame_hook.
Il s'agit donc d'un fragment.