[BusyBox 0001431]: [patch] new applet: netmsg

bugs at busybox.net bugs at busybox.net
Mon Jul 23 10:36:14 UTC 2007


A NOTE has been added to this issue. 
====================================================================== 
http://busybox.net/bugs/view.php?id=1431 
====================================================================== 
Reported By:                mirabilos
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   1431
Category:                   New Features
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             07-20-2007 05:00 PDT
Last Modified:              07-23-2007 03:36 PDT
====================================================================== 
Summary:                    [patch] new applet: netmsg
Description: 
Several Embedded GNU/Linux projects use a tool called “netmsg”
to send simple UDP message datagrams over the network to signal
important pre-/sbin/init information to the user, e.g. when and
how to enable the failsafe mode.

This patch adds the netmsg applet to busybox.

====================================================================== 

---------------------------------------------------------------------- 
 vda - 07-21-07 07:06  
---------------------------------------------------------------------- 
1. You can use netcat for that, we have that in bbox.

2. It's easier to discuss patches on the mailing list.

3. Review:

+       while (strlen(argv[2]) > 0) {

argv[2][0] != 0

+               memset(buf, 0, sizeof (buf));
+
+               buf[0] = 0xde;
+               buf[1] = 0xad;
+               strlcpy(buf + 2, argv[2], sizeof (buf) - 2);

Use strncpy, it will do memset for you.

+               argv[2] += strlen(buf + 2);

In effect you scan argv[2] byte-by-byte twice here.

+
+               if (setsockopt(s, SOL_SOCKET, SO_BROADCAST,
+                   (caddr_t)&optval, sizeof (optval)) < 0) {
+                       perror("setsockopt()");

bb_perror_msg_and_die() 

---------------------------------------------------------------------- 
 mirabilos - 07-23-07 03:36  
---------------------------------------------------------------------- 
Feel free to change the things you found, I don't object,
and the original author seems to want this in upstream too. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
07-20-07 05:00  mirabilos      New Issue                                    
07-20-07 05:00  mirabilos      Status                   new => assigned     
07-20-07 05:00  mirabilos      Assigned To               => BusyBox         
07-20-07 05:00  mirabilos      File Added: 300-netmsg.patch                    
07-21-07 07:06  vda            Note Added: 0002612                          
07-23-07 03:36  mirabilos      Note Added: 0002632                          
======================================================================




More information about the busybox-cvs mailing list