Changeset 2967


Ignore:
Timestamp:
2006-01-14T02:21:53+01:00 (12 years ago)
Author:
nbd
Message:

add ip address parameter to netmsg utility

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/openwrt/package/busybox/patches/300-netmsg.patch

    r2893 r2967  
    6464+       unsigned char buf[1001]; 
    6565+ 
    66 +       if (argc != 2) { 
    67 +               fprintf(stderr, "usage: %s \"message\"\n", argv[0]); 
     66+       if (argc != 3) { 
     67+               fprintf(stderr, "usage: %s <ip> \"<message>\"\n", argv[0]); 
    6868+               exit(1); 
    6969+       } 
     
    7676+       memset(&addr, 0, sizeof(addr)); 
    7777+       addr.sin_family = AF_INET; 
    78 +       addr.sin_addr.s_addr = htonl(0xffffffff); 
     78+       addr.sin_addr.s_addr = inet_addr(argv[1]); 
    7979+       addr.sin_port = htons(0x1337); 
    8080+ 
     
    8383+       buf[1] = 0xad; 
    8484+ 
    85 +       strncpy(buf + 2, argv[1], 998); 
     85+       strncpy(buf + 2, argv[2], 998); 
    8686+ 
    8787+       if (setsockopt (s, SOL_SOCKET, SO_BROADCAST, (caddr_t) &optval, sizeof (optval)) < 0) { 
Note: See TracChangeset for help on using the changeset viewer.