Changeset 7c410f9


Ignore:
Timestamp:
11/09/21 23:42:52 (3 years ago)
Author:
Edwin Eefting <edwin@datux.nl>
Branches:
master
Children:
105afb5, 929bb42
Parents:
1ebb340
Message:

fix

Location:
npl/syn3/synwatchdog
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • npl/syn3/synwatchdog/syndog.c

    r1ebb340 r7c410f9  
    2626#define MAX_OBSERVE_DELAY 10
    2727
    28 #define MAX_ETHS 10
     28#define MAX_ETHS 2000
    2929
    3030//size of eth device names
    31 #define DEV_SIZE 10
     31#define DEV_SIZE 30
    3232
    3333
     
    257257                                ifindex2dev(s, ifindex, dev);
    258258
    259                                 //..store source mac adress of the destination device in packet:
    260                                 char src_mac[ETH_ALEN];
    261                                 getmac(s, dev, src_mac);
    262                                 memcpy((void*)(packet+ETH_ALEN), (void*)src_mac, ETH_ALEN);
    263 
    264                                 //select correct destination interface:
    265                                 socket_address.sll_ifindex  = ifindex;
    266 
    267                                 //send it!
    268                                 int send_result;
    269                                 send_result = sendto(
    270                                         s,
    271                                         packet,
    272                                         ETH_HLEN +datalen,
    273                                         0,
    274                                         (struct sockaddr*)&socket_address,
    275                                         sizeof(socket_address));
    276 
    277                                 if (send_result == -1 && errno!=6 && errno!= 100)
    278                                         printf("send error on interface %d: %d: %s\n", ifindex, errno, strerror(errno));
     259                                if (strncmp("eth",dev,3)==0)
     260                                {
     261
     262                                        //..store source mac adress of the destination device in packet:
     263                                        char src_mac[ETH_ALEN];
     264                                        getmac(s, dev, src_mac);
     265                                        memcpy((void*)(packet+ETH_ALEN), (void*)src_mac, ETH_ALEN);
     266
     267                                        //select correct destination interface:
     268                                        socket_address.sll_ifindex  = ifindex;
     269
     270                                        //send it!
     271                                        int send_result;
     272                                        send_result = sendto(
     273                                                s,
     274                                                packet,
     275                                                ETH_HLEN +datalen,
     276                                                0,
     277                                                (struct sockaddr*)&socket_address,
     278                                                sizeof(socket_address));
     279
     280                                        if (send_result == -1 && errno!=6 && errno!= 100)
     281                                                printf("send error on interface %d: %d: %s\n", ifindex, errno, strerror(errno));
     282                                }
    279283                        }
    280284                        sleep(BARF_DELAY);
  • npl/syn3/synwatchdog/synwatchdog.build

    r1ebb340 r7c410f9  
    1 6419
     16422
  • npl/syn3/synwatchdog/synwatchdog.md5

    r1ebb340 r7c410f9  
    11b3e0140fa5758f8a744b4f7838cc504c  ./Makefile
    220fd55b55f46e80f95f7379bc0725e76e  ./run
    3 d41ad071e4038d82a6201808d5e50b86  ./syndog.c
    4 a6d9ce4aa96aee981a2b323069c75f62  ./synwatchdog.pkg
     38c5abe40ea1c82804d11e48bf085dcf5  ./syndog.c
     4280d5fc169584409e1de8f29edc77b04  ./synwatchdog.pkg
    550eb9646e63e0d19ae4c4993bd8976024  ./synwatchdog.SlackBuild
    6 9db16788c1e8a39e33d124de305195f5  ./synwatchdog.SlackBuild.log.gz
     6e4de1398523305cb607435535cbe1544  ./synwatchdog.SlackBuild.log.gz
Note: See TracChangeset for help on using the changeset viewer.