diff options
Diffstat (limited to 'networking/udhcp/script.c')
-rw-r--r-- | networking/udhcp/script.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/networking/udhcp/script.c b/networking/udhcp/script.c index 8dff9b700..4ae17fb8d 100644 --- a/networking/udhcp/script.c +++ b/networking/udhcp/script.c | |||
@@ -90,19 +90,19 @@ static char *alloc_fill_opts(uint8_t *option, const struct dhcp_option *type_p, | |||
90 | dest += sprintf(dest, "%u", *option); | 90 | dest += sprintf(dest, "%u", *option); |
91 | break; | 91 | break; |
92 | case OPTION_U16: | 92 | case OPTION_U16: |
93 | memcpy(&val_u16, option, 2); | 93 | move_from_unaligned16(val_u16, option); |
94 | dest += sprintf(dest, "%u", ntohs(val_u16)); | 94 | dest += sprintf(dest, "%u", ntohs(val_u16)); |
95 | break; | 95 | break; |
96 | case OPTION_S16: | 96 | case OPTION_S16: |
97 | memcpy(&val_s16, option, 2); | 97 | move_from_unaligned16(val_s16, option); |
98 | dest += sprintf(dest, "%d", ntohs(val_s16)); | 98 | dest += sprintf(dest, "%d", ntohs(val_s16)); |
99 | break; | 99 | break; |
100 | case OPTION_U32: | 100 | case OPTION_U32: |
101 | memcpy(&val_u32, option, 4); | 101 | move_from_unaligned32(val_u32, option); |
102 | dest += sprintf(dest, "%lu", (unsigned long) ntohl(val_u32)); | 102 | dest += sprintf(dest, "%lu", (unsigned long) ntohl(val_u32)); |
103 | break; | 103 | break; |
104 | case OPTION_S32: | 104 | case OPTION_S32: |
105 | memcpy(&val_s32, option, 4); | 105 | move_from_unaligned32(val_s32, option); |
106 | dest += sprintf(dest, "%ld", (long) ntohl(val_s32)); | 106 | dest += sprintf(dest, "%ld", (long) ntohl(val_s32)); |
107 | break; | 107 | break; |
108 | case OPTION_STRING: | 108 | case OPTION_STRING: |
@@ -183,7 +183,7 @@ static char **fill_envp(struct dhcpMessage *packet) | |||
183 | /* Fill in a subnet bits option for things like /24 */ | 183 | /* Fill in a subnet bits option for things like /24 */ |
184 | if (dhcp_options[i].code == DHCP_SUBNET) { | 184 | if (dhcp_options[i].code == DHCP_SUBNET) { |
185 | uint32_t subnet; | 185 | uint32_t subnet; |
186 | memcpy(&subnet, temp, 4); | 186 | move_from_unaligned32(subnet, temp); |
187 | envp[j++] = xasprintf("mask=%d", mton(subnet)); | 187 | envp[j++] = xasprintf("mask=%d", mton(subnet)); |
188 | } | 188 | } |
189 | next: | 189 | next: |