dhcpd: apparently, sometimes IP is in ciaddr, not requested_ip...
[oweals/busybox.git] / networking / slattach.c
index 02ecb5e9fc87f5f2f28b755ce670f9336716afcc..12a3067de219ad277f823c623282775f67d0efd8 100644 (file)
@@ -20,7 +20,7 @@ struct globals {
        int handle;
        int saved_disc;
        struct termios saved_state;
-};
+} FIX_ALIASING;
 #define G (*(struct globals*)&bb_common_bufsiz1)
 #define handle       (G.handle      )
 #define saved_disc   (G.saved_disc  )
@@ -64,7 +64,7 @@ static int set_termios_state_or_warn(struct termios *state)
  * Go on after errors: we want to restore as many controlled ttys
  * as possible.
  */
-static void restore_state_and_exit(int exitcode) ATTRIBUTE_NORETURN;
+static void restore_state_and_exit(int exitcode) NORETURN;
 static void restore_state_and_exit(int exitcode)
 {
        struct termios state;
@@ -114,13 +114,13 @@ static void set_state(struct termios *state, int encap)
        }
 }
 
-static void sig_handler(int signo ATTRIBUTE_UNUSED)
+static void sig_handler(int signo UNUSED_PARAM)
 {
        restore_state_and_exit(EXIT_SUCCESS);
 }
 
 int slattach_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int slattach_main(int argc ATTRIBUTE_UNUSED, char **argv)
+int slattach_main(int argc UNUSED_PARAM, char **argv)
 {
        /* Line discipline code table */
        static const char proto_names[] ALIGN1 =
@@ -206,6 +206,8 @@ int slattach_main(int argc ATTRIBUTE_UNUSED, char **argv)
                state.c_cflag = CS8 | HUPCL | CREAD
                              | ((opt & OPT_L_local) ? CLOCAL : 0)
                              | ((opt & OPT_F_noflow) ? 0 : CRTSCTS);
+               cfsetispeed(&state, cfgetispeed(&saved_state));
+               cfsetospeed(&state, cfgetospeed(&saved_state));
        }
 
        if (opt & OPT_s_baud) {