- case 0x0800:
- return route_ipv4(packet);
- case 0x86DD:
- return route_ipv6(packet);
-/*
- case 0x8137:
- return route_ipx(packet);
- case 0x0806:
- return route_arp(packet);
-*/
- default:
- /* TODO: try MAC as last resort? */
- if(debug_lvl >= DEBUG_TRAFFIC)
- {
- syslog(LOG_WARNING, _("Cannot route packet: unknown type %hx"), type);
- }
- return NULL;
- }
+ subnet = new_subnet();
+ subnet->type = SUBNET_MAC;
+ memcpy(&subnet->net.mac.address, (mac_t *)(&packet->data[0]), sizeof(mac_t));
+ subnet_add(source, subnet);
+ }
+
+ /* FIXME: do ageing and roaming */
+
+ /* Lookup destination address */
+
+ dst = lookup_subnet_mac((mac_t *)(&packet->data[6]))->owner;
+
+ if(!dst)
+ if(debug_lvl >= DEBUG_TRAFFIC)
+ {
+ syslog(LOG_WARNING, _("Cannot route packet: unknown destination address %x:%x:%x:%x:%x:%x"),
+ packet->data[6],
+ packet->data[7],
+ packet->data[8],
+ packet->data[9],
+ packet->data[10],
+ packet->data[11]);
+ }
+cp
+ return dst;