'Dropping only UDP packets in RPL

1)I am trying to drop only UDP packets in RPL in Contigi-ng OS.
I modified the code in/contiki/core/net/tcpip.c as:

...
    static void
    packet_input(void)
    {
    #if DEST_PORT_IS_MAL_DROP
    if ((UIP_IP_BUF->proto == UIP_PROTO_UDP) && 
    (uip_ntohs(UIP_UDP_BUF->destport)==UDP_MALICIOUS_PORT)){
    uip_len=0;}
    #endif
    #if UIP_CONF_IP_FORWARD
    if(uip_len > 0){
...

This drops all packets whose destport = UDP_MALICIOUS_PORT and do not know how to drop only UDP packets and allow control messages.

Thanks in advance



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source