Revision 8b58f565 proto/babel/packets.c

View differences:

proto/babel/packets.c
162 162
  return i;
163 163
}
164 164

  
165
static inline u16
165
static inline uint
166 166
get_time16(const void *p)
167 167
{
168
  u16 v = get_u16(p) / BABEL_TIME_UNITS;
169
  return MAX(1, v);
168
  uint v = get_u16(p) * BABEL_TIME_UNITS;
169
  return MAX(BABEL_MIN_INTERVAL, v);
170 170
}
171 171

  
172 172
static inline void
173
put_time16(void *p, u16 v)
173
put_time16(void *p, uint v)
174 174
{
175
  put_u16(p, v * BABEL_TIME_UNITS);
175
  put_u16(p, v / BABEL_TIME_UNITS);
176 176
}
177 177

  
178 178
static inline void

Also available in: Unified diff